{include file='public/header'}
  
  <body>
    <div class="x-body layui-anim layui-anim-up">
        <form class="layui-form" method="post">
          <div class="layui-form-item">
              <label for="L_username" class="layui-form-label">
                  <span class="x-red">*</span>手机号
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_username" name="username" required="" value="{$user.username}" lay-verify="username"
                  autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>将会成为您唯一的登入名
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_nickname" class="layui-form-label">
                  <span class="x-red">*</span>姓名
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_nickname" name="nickname" required="" value="{$user.nickname}" lay-verify="nikename"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <!-- <div class="layui-form-item">
              <label for="L_nickname" class="layui-form-label">
                  <span class="x-red">*</span>以太币
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="L_user_money" name="user_money" required="" value="{$user.user_money}" lay-verify="nikename"
                  autocomplete="off" class="layui-input">
              </div>
          </div> -->
          <input type="hidden" name="user_id" value="{$user.user_id}">
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="member_edit" lay-submit="">
                  修改
              </button>
          </div>
      </form>
    </div>
<script>
var url = '{:url("member_edit")}';
layui.use(['form','layer'], function(){
    $ = layui.jquery;
    var form = layui.form
    ,layer = layui.layer;
    //监听提交
    form.on('submit(member_edit)', function(data){
        $.post(url,data.field,function(res){
            if(res.code == 1){
                layer.alert(res.msg, {icon: 6},function () {
                window.location.href = res.url;
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
                });
            }else{
                layer.alert(res.msg, {icon: 5}); 
            }
        },'json')
        return false;
    });

});
</script>

  </body>

</html>